]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popup-menu: Fix allocation in RTL locales
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 22 Sep 2011 13:33:43 +0000 (15:33 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 22 Sep 2011 19:52:26 +0000 (21:52 +0200)
Commit ed7d4928e5 fixed some width-for-height cases in popup menu items,
but did not consider RTL locales. Fix this.

https://bugzilla.gnome.org/show_bug.cgi?id=659827

js/ui/popupMenu.js

index 53ddc9712605e226f1c574263edb478258e62d32..3ee3c1770dfc64096b6ff005ea5c2de5ed6b1f52 100644 (file)
@@ -320,10 +320,14 @@ PopupBaseMenuItem.prototype = {
                 }
                 extraWidth = availWidth - naturalWidth;
             } else {
-                if (child.span == -1)
-                    availWidth = box.x2 - x;
-                else
+                if (child.span == -1) {
+                    if (direction == St.TextDirection.LTR)
+                        availWidth = box.x2 - x;
+                    else
+                        availWidth = x - box.x1;
+                } else {
                     availWidth = naturalWidth;
+                }
                 extraWidth = 0;
             }